﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR43Response", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR43Response))]
    public class RR43ResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR43Response clazz;
        
        public RR43ResponseSerializer(IRR43Response clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("dok");
            if (clazz.Dok!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR43Response>dok>dok", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Dok.Count);
                for (int x = 0; ((clazz.Dok != null) 
                            && (x < clazz.Dok.Count)); x = (x + 1)) {
                    if (clazz.Dok[x]!=null) {
                        Writer.WriteStartElement("dok");
                        global::Xtee.Core.SerializationMetadata metaDok = this.GetMetaData(clazz.Dok[x]);
                        Writer.WriteTypeAttribute(metaDok.TypeQualifiedName.Namespace, metaDok.TypeQualifiedName.Name);
                        metaDok.NewSerializer(clazz.Dok[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Dok");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR43Response>veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR43Response>veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR43Response>veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR43Response>veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="dok") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR43Response>dok");
                }
                clazz.Dok = new System.Collections.Generic.List<RR43Response.IDokType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("dok");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "dok")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR43Response>dok>dok");
                        }
                        global::Xtee.Core.SerializationMetadata metaDok = this.GetMetaData<RR43Response.IDokType>(Reader, ">>>RR43Response>dok>dok", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR43Response.IDokType item = metaDok.NewEntity<RR43Response.IDokType>();
                        clazz.Dok.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("dok");
                            metaDok.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR43Response>dok", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR43Response>dok>dok", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR43Response.DokType))]
        public class DokTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR43Response.IDokType clazz;
            
            public DokTypeSerializer(RR43Response.IDokType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("dok.IsikIsikukood");
                if (clazz.DokIsikIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokIsikIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokIsikIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.IsikEesnimi");
                if (clazz.DokIsikEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokIsikEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokIsikEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.IsikPerenimi");
                if (clazz.DokIsikPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokIsikPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokIsikPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.IsikStaatus");
                if (clazz.DokIsikStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokIsikStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokIsikStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokRoll");
                if (clazz.DokDokRoll!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokRoll))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokRoll");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokIsikukood");
                if (clazz.DokDokIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokEesnimi");
                if (clazz.DokDokEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokPerenimi");
                if (clazz.DokDokPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokVanaEnimi");
                if (clazz.DokDokVanaEnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokVanaEnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokVanaEnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokVanaPerenimi");
                if (clazz.DokDokVanaPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokVanaPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokVanaPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokTyyp");
                if (clazz.DokDokTyyp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokTyyp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokTyyp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokRiik");
                if (clazz.DokDokRiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokRiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokRiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokSeeria");
                if (clazz.DokDokSeeria!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokSeeria))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokSeeria");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokNr");
                if (clazz.DokDokNr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokNr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokNr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokSyndKuup");
                if (clazz.DokDokSyndKuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokSyndKuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokSyndKuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokKehtAlgus");
                if (clazz.DokDokKehtAlgus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokKehtAlgus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokKehtAlgus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokKehtLopp");
                if (clazz.DokDokKehtLopp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokKehtLopp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokKehtLopp");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokValjastamisKuup");
                if (clazz.DokDokValjastamisKuup!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokValjastamisKuup))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokValjastamisKuup");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokValjastaja");
                if (clazz.DokDokValjastaja!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokValjastaja))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokValjastaja");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("dok.DokStaatus");
                if (clazz.DokDokStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokStaatus");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="dok.IsikIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.IsikIsikukood");
                    }
                    clazz.DokIsikIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.IsikIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.IsikIsikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.IsikEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.IsikEesnimi");
                    }
                    clazz.DokIsikEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.IsikEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.IsikEesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.IsikPerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.IsikPerenimi");
                    }
                    clazz.DokIsikPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.IsikPerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.IsikPerenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.IsikStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.IsikStaatus");
                    }
                    clazz.DokIsikStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.IsikStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.IsikStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokRoll") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokRoll");
                    }
                    clazz.DokDokRoll = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokRoll")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokRoll", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokIsikukood");
                    }
                    clazz.DokDokIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokIsikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokEesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokEesnimi");
                    }
                    clazz.DokDokEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokEesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokEesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokPerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokPerenimi");
                    }
                    clazz.DokDokPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokPerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokPerenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokVanaEnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokVanaEnimi");
                    }
                    clazz.DokDokVanaEnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokVanaEnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokVanaEnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokVanaPerenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokVanaPerenimi");
                    }
                    clazz.DokDokVanaPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokVanaPerenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokVanaPerenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokTyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokTyyp");
                    }
                    clazz.DokDokTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokTyyp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokTyyp", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokRiik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokRiik");
                    }
                    clazz.DokDokRiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokRiik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokRiik", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokSeeria") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokSeeria");
                    }
                    clazz.DokDokSeeria = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokSeeria")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokSeeria", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokNr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokNr");
                    }
                    clazz.DokDokNr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokNr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokNr", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokSyndKuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokSyndKuup");
                    }
                    clazz.DokDokSyndKuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokSyndKuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokSyndKuup", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokKehtAlgus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokKehtAlgus");
                    }
                    clazz.DokDokKehtAlgus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokKehtAlgus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokKehtAlgus", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokKehtLopp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokKehtLopp");
                    }
                    clazz.DokDokKehtLopp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokKehtLopp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokKehtLopp", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokValjastamisKuup") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokValjastamisKuup");
                    }
                    clazz.DokDokValjastamisKuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokValjastamisKuup")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokValjastamisKuup", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokValjastaja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokValjastaja");
                    }
                    clazz.DokDokValjastaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokValjastaja")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokValjastaja", Reader.LocalName);
                }
                if (Reader.LocalName=="dok.DokStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR43Response>dok>dok>dok.DokStaatus");
                    }
                    clazz.DokDokStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("dok.DokStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR43Response>dok>dok>dok.DokStaatus", Reader.LocalName);
                }
            }
        }
    }
}
